<%@ page contentType="text/html;charset=UTF-8" %>
<style type="text/css">
.avatarUpload_bg{
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: white;
z-index:5001;
-moz-opacity: 0.8;
opacity:.80;
filter: alpha(opacity=80);
}
.avatarUpload_content {
display: none;
position: absolute;
width: 652px;
height: 519px; 
background-color:#fff;
z-index:5002;
overflow: auto;

left:50%;/*FF IE7*/
top:50%;/*FF IE7*/

margin-left:-325px!important;/*FF IE7 half of its width */
margin-top:-250px!important;/*FF IE7 half of its height*/

margin-top:0px;
position:fixed!important;/*FF IE7*/
position:absolute;/*IE6*/

_top:       expression(eval(document.compatMode &&
            document.compatMode=='CSS1Compat') ?
            documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/
            document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/
            
}
.avatarUpload_formdiv{
border-left:1px solid #e0e0e0;
border-right:1px solid #e0e0e0;
border-bottom:1px solid #e0e0e0;
overflow-y: auto;
}
</style>

<script type="text/javascript">
//弹出隐藏层
var imageUrl;
function avatarUploadMess_ShowDiv(show_div,bg_div,url){
document.getElementById(show_div).style.display='block';
document.getElementById(bg_div).style.display='block' ;

var bgdiv = document.getElementById(bg_div);
bgdiv.style.width = document.body.scrollWidth;
// bgdiv.style.height = $(document).height();
$("#"+bg_div).height($(document).height());
//图片地址
imageUrl = url;
var FlashObject = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+
		'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"'+
		'WIDTH="650" HEIGHT="450" id="myMovieName">'+
		'<PARAM NAME=movie VALUE="${ctxStatic}/front/avatar/avatar.swf">'+
		'<PARAM NAME=quality VALUE=high>'+
		'<PARAM NAME=bgcolor VALUE=#FFFFFF>'+
		'<param name="flashvars" value="imgUrl=${ctx}/download?filePath='+imageUrl+'&uploadUrl=${ctx }/kindeditor/uploadLogo&uploadSrc=false&pSize=162|162|48|48|20|20" />'+
		'<EMBED src="${ctxStatic}/front/avatar/avatar.swf" quality=high bgcolor=#FFFFFF WIDTH="650" HEIGHT="450" wmode="transparent" flashVars="imgUrl=${ctx}/download?filePath='+imageUrl+'&uploadUrl=${ctx }/kindeditor/uploadLogo&uploadSrc=false&pSize=162|162|48|48|20|20"'+
		'NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" allowScriptAccess="always"'+
		'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'+
		'</EMBED>'+
		'</OBJECT>';
$("#altContent").html(FlashObject);
};

//关闭弹出层
function avatarUploadMess_CloseDiv(show_div,bg_div)
{
	document.getElementById(show_div).style.display='none';
	document.getElementById(bg_div).style.display='none';
	imageUrl="";
};

function uploadevent(status,picUrl,callbackdata){
 	 //alert(picUrl); //后端存储图片
 	//alert(callbackdata);
    status += '';
    switch(status){
	    case '1':
			var time = new Date().getTime();
			var filename162 = picUrl+'_162.jpg';
			var filename48 = picUrl+'_48.jpg';
			var filename20 = picUrl+"_20.jpg";
			showPhoto(filename162);
			//关闭div层
		  	avatarUploadMess_CloseDiv('avatarUpload_MyDiv','avatarUpload_fade');
			break;
	    case '-1':
		  	avatarUploadMess_ShowDiv('avatarUpload_MyDiv','avatarUpload_fade',imageUrl);
		    break;
	    default:
	    	avatarUploadMess_ShowDiv('avatarUpload_MyDiv','avatarUpload_fade',imageUrl);
   } 
}
</script>

<!--弹出层时背景层DIV-->
<div id="avatarUpload_fade" class="avatarUpload_bg">
</div>
<div id="avatarUpload_MyDiv" class="avatarUpload_content">
<div class="puptitle"><span class="close"><a href="javascript:;" onclick="avatarUploadMess_CloseDiv('avatarUpload_MyDiv','avatarUpload_fade');"></a></span><h1 id="titleH">logo上传</h1></div>
<div class="avatarUpload_formdiv">
	<div id="altContent">
		
	</div>
</div>
</div>